<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>学生管理系统</title>
 <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
 
 
 <script>
 //主页面js文件
 
 //增加
 function submitit1(){
	 document.form1.action="AddStudentServlet"
	 //document.form1.submit();
 }
 //更改
 function submitit3(){
	 document.form1.action="ChangeStudentServlet"
	// document.form1.submit();
}
 //删除
 function submitit2(){
	 document.form2.action="DelStudentServlet"
	 //document.form2.submit();
 }
 //查找
  function submitit4(){
	 document.form2.action="RegistServlet"
	// document.form2.submit();
 }
 </script>
 
</head>
<body>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<h3 class="text-center">
				学生管理系统
			</h3>
		</div>
	</div>
	<div class="row clearfix">
		<div class="col-md-12 column">
			<form class="form-horizontal" role="form" name = "form1" METHOD="POST">
				<div class="form-group">
					 <label for="inputEmail31" class="col-sm-2 control-label">学号</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputEmail31" name='A'/>
					</div>
				</div>
				<div class="form-group">
					 <label for="inputPassword32" class="col-sm-2 control-label">姓名</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputPassword32" name='B'/>
					</div>
				</div>
				<div class="form-group">
					 <label for="inputPassword33" class="col-sm-2 control-label">班级</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputPassword33" name='C'/>
					</div>
				</div>
				<div class="form-group">
					 <label for="inputPassword34" class="col-sm-2 control-label">年级</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputPassword34" name='D'/>
					</div>
				</div>
				<div class="form-group">
					 <label for="inputPassword35" class="col-sm-2 control-label">宿舍</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputPassword35" name='E'/>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						 <button type="submit" class="btn btn-default" onClick=submitit1();>添加学生信息</button>
						  <button type="submit" class="btn btn-default" onClick=submitit3();>更改学生信息</button>
						    <div class="alert alert-danger">
    							<a href="#" class="alert-link">
    							<%
        				        String state = (String) session.getAttribute("B1");
       				    	    session.removeAttribute("B1");
          				 	   		if(state != null){
   				         			  out.print(state);
              						}
             			 		%>
    							</a>
							</div>
						   
					</div>
				</div>
			</form>
			
			<form class="form-horizontal" role="form" name = "form2" METHOD="POST">
				<div class="form-group">
					 <label for="inputEmail36" class="col-sm-2 control-label">学号</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="inputEmail36" name='A'/>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						 <button type="submit" class="btn btn-default" onClick=submitit2();>删除学生信息</button>
						 <button type="submit" class="btn btn-default" onClick=submitit4();>查找学生信息</button>
						 
             			  <div class="alert alert-danger">
    							<a href="#" class="alert-link">
    							<%//%里面的是全局变量
        				     state = (String) session.getAttribute("B2");
       				    	 session.removeAttribute("B2");
          				 	   if(state != null){
   				         		out.print(state);
              					}
             					 %>
    							</a>
							</div>
					</div>
				</div>
			</form>
			<div class="row clearfix">
				<div class="col-md-1 column">
				</div>
				<div class="col-md-11 column">
					<table class="table">
						<thead>
							<tr>
								<th>
									学号
								</th>
								<th>
									姓名
								</th>
								<th>
									班级
								</th>
								<th>
									年级
								</th>
								<th>
									宿舍
								</th>
							</tr>
						</thead>
						<tbody>
							<tr class="info">
								<td>
									201931101060
								</td>
								<td>
									韩雅琪
								</td>
								<td>
									1902
								</td>
								<td>
									2019
								</td>
								<td>
									13-1-09
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>